{% extends "base.html" %}
{% block title %}PTSkit 种子搜索{% endblock %}
{% block styles %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/ptskit.css') }}">
{% endblock %}
{% block content %}
<div class="ptskit-container">
    <div class="page-header">
        <h1>PTSkit 短剧种子列表</h1>
        <div class="search-controls">
            <div class="input-group">
                <input type="text" id="search-input" placeholder="仅支持搜索当页种子" class="form-input">
                <button id="search-btn" class="btn btn-primary">搜索</button>
            </div>
            <div class="pagination-controls">
                <button id="prev-page" class="btn btn-secondary" disabled>上一页</button>
                <span id="page-info" class="page-info">第 0 页</span>
                <button id="next-page" class="btn btn-secondary">下一页</button>
            </div>
        </div>
    </div>

    <div class="torrents-container">
        <div id="loading-indicator" class="loading-indicator">
            <div class="loading-spinner"></div>
            <span>加载中...</span>
        </div>
        <div id="error-message" class="error-message" style="display: none;"></div>
        <table id="torrents-table" class="torrents-table">
            <thead>
                <tr>
                    <th>标题</th>
                    <th>分类</th>
                    <th>标签</th>
                    <th>大小</th>
                    <th>做种数</th>
                    <th>下载数</th>
                    <th>完成数</th>
                    <th>发布时间</th>
                    <th>上传者</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody id="torrents-body">
                <!-- 种子数据将通过JavaScript动态填充 -->
            </tbody>
        </table>
    </div>

    <!-- 种子详情模态框 -->
    <div id="torrent-detail-modal" class="modal">
        <div class="modal-content">
            <div class="modal-header">
                <h2 id="modal-title">种子详情</h2>
                <button id="close-modal" class="close-btn">&times;</button>
            </div>
            <div class="modal-body">
                <div id="modal-content">
                    <!-- 种子详情将通过JavaScript动态填充 -->
                </div>
            </div>
            <div class="modal-footer">
                <button id="open-in-qb" class="btn btn-info">QB下载</button>
                <button id="open-in-tr" class="btn btn-danger">TR下载</button>
                <button id="close-modal-btn" class="btn btn-default">关闭</button>
            </div>
        </div>
    </div>
</div>
{% endblock %}
{% block scripts %}
<script src="{{ url_for('static', filename='js/ptskit.js') }}"></script>
{% endblock %}